<template>
  <div>
    <span style="color: red; font-size: 18px;margin-right: 5px;">*</span><a-select show-search placeholder="选择仪器串" v-model:value="instring" :options="instringVals"
      @change="handleChange"></a-select>
  </div>
</template>
<script setup>
import SchemeInstrument from '@/api/design/instString.js'
const emit = defineEmits(['confirm']);
// const props = defineProps({
//   wellId: {
//     type: String
//   }
// })
const instringVals = ref([])
const instring = ref([])

function handleChange(e) {
  emit("confirm", e);
}

function getList() {
  let queryParams = { order: "DESC", pageNum: 1, pageSize: 10, sortBy: "id", schemeId: localStorage.getItem("schemeId") }
  SchemeInstrument.queryList(queryParams).then(res => {
    // console.log('仪器串', res)
    let tarr = res.content
    tarr = tarr.map(ele => {
      ele.label = `第${ele.numbers}趟仪器串`
      ele.value = ele.id
      return ele
    })
    instringVals.value = tarr
  })
}
getList()
</script>